﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:MvvmLite="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
                    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                    mc:Ignorable="d">

    <!--  *********************************  -->
    <!--  Starting Hands Popup Templates  -->
    <!--  *********************************  -->

    <!--  Starting Hands Progress Indicator Popup  -->
    <ControlTemplate x:Name="StartingHandsProgressIndicatorControleTemplate">
        <Grid>
            <StackPanel VerticalAlignment="Center" Orientation="Vertical">
                <TextBlock Grid.Row="0"
                           Grid.Column="0"
                           Height="67"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center"
                           Foreground="{StaticResource PhoneAccentBrush}"
                           Style="{StaticResource THCStatsLargeHeaderText}"
                           Text="Loading Hands" />
                <toolkit:PerformanceProgressBar Height="50"
                                                HorizontalContentAlignment="Stretch"
                                                IsIndeterminate="True" />
            </StackPanel>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Name="SkyDriveFolderListingProgressIndicatorControleTemplate">
        <Border Style="{StaticResource OutsPopupBorderStyle}">
            <Grid>
                <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                    <TextBlock Grid.Row="0"
                           Grid.Column="0"
                           Height="67"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center"
                           Foreground="{StaticResource PhoneAccentBrush}"
                           Style="{StaticResource THCStatsLargeHeaderText}"
                           Text="{Binding StatusText}" />
                    <ProgressBar Height="50"
                             HorizontalContentAlignment="Stretch"
                             IsIndeterminate="True" />
                </StackPanel>
            </Grid>
        </Border>
    </ControlTemplate>

    <!--  Starting Hands Description Popup  -->
    <ControlTemplate x:Name="StartingHandsDescriptionControlTemplate">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="65" />
                <RowDefinition />
                <RowDefinition Height="150" />
            </Grid.RowDefinitions>

            <Border x:Name="StartingHandBackgroundRectangle"
                    Grid.RowSpan="3"
                    Style="{StaticResource OutsPopupBorderStyle}" />

            <TextBlock x:Name="StartingHandPopupHeader"
                       Grid.Row="0"
                       Grid.Column="0"
                       Grid.ColumnSpan="4"
                       Style="{StaticResource THCStatsLargeHeaderText}"
                       Text="Hand Description" />

            <Border x:Name="border"
                    Grid.Row="1"
                    Width="420"
                    Height="300"
                    Style="{StaticResource PopupBorderStyle}">
                <TextBlock Width="408"
                           Height="288"
                           Style="{StaticResource THCDescriptionMediumValueStyle}"
                           Text="{Binding Description}" />
            </Border>

            <Button x:Name="StartingHandPopupSelectButton"
                    Grid.Row="2"
                    Grid.ColumnSpan="4"
                    Width="48"
                    Height="48"
                    HorizontalAlignment="Center"
                    Style="{StaticResource RoundButtonCircleStyle}">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <MvvmLite:EventToCommand x:Name="OutsVisibilitySelectCommand" Command="{Binding Visibility2Command}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <Image x:Name="ImageOutsSelect" Source="../Images/Icons/48/appbar.check.rest.png" />
            </Button>
        </Grid>
    </ControlTemplate>

    <!--  Starting Hands Selected Description Popup  -->
    <ControlTemplate x:Name="StartingHandsSelectedHandControlTemplate">
        <Grid x:Name="BorderGrid">
            <Grid.Resources>
                <Storyboard x:Name="Timeline">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0.5" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.75" />
                        <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
                        <EasingDoubleKeyFrame KeyTime="0" Value="0.5" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.75" />
                        <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Opacity)">
                        <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.9" />
                        <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.8" />
                    </DoubleAnimationUsingKeyFrames>
                    <PointAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)">
                        <EasingPointKeyFrame KeyTime="0" Value="0.5,0.5" />
                        <EasingPointKeyFrame KeyTime="0:0:0.5" Value="0.5,0.5" />
                    </PointAnimationUsingKeyFrames>
                </Storyboard>
            </Grid.Resources>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="VisualStateGroup">
                    <VisualState x:Name="VisualState" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="65" />
                <RowDefinition />
                <RowDefinition Height="150" />
            </Grid.RowDefinitions>

            <Border x:Name="SelectedHandBackgroundRectangle"
                    Grid.RowSpan="3"
                    Style="{StaticResource OutsPopupBorderStyle}" />

            <TextBlock x:Name="SelectedHandPopupHeader"
                       Grid.Row="0"
                       Grid.Column="0"
                       Grid.ColumnSpan="4"
                       Style="{StaticResource THCStatsLargeHeaderText}"
                       Text="Strength Description" />

            <Border x:Name="border"
                    Grid.Row="1"
                    Width="420"
                    Height="400"
                    Style="{StaticResource PopupBorderStyle}">
                <Border.RenderTransform>
                    <CompositeTransform />
                </Border.RenderTransform>
                <StackPanel Orientation="Vertical">
                    <TextBlock Style="{StaticResource THCMediumValueStyle}" Text="{Binding SelectedHandHeader}" />
                    <TextBlock HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               Style="{StaticResource THCMediumValueStyle}"
                               Text="{Binding SelectedHandDescription}"
                               TextWrapping="Wrap" />
                    <Grid HorizontalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="25" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Image x:Name="StartingHandHoleCardOne"
                               Grid.Column="0"
                               HorizontalAlignment="Right"
                               Source="{Binding SelectedHandHoleCardOne}"
                               Style="{StaticResource THCCardStyle}" />
                        <Image x:Name="StartingHandHoleCardTwo"
                               Grid.Column="2"
                               HorizontalAlignment="Left"
                               Source="{Binding SelectedHandHoleCardTwo}"
                               Style="{StaticResource THCCardStyle}" />
                    </Grid>
                </StackPanel>
            </Border>

            <Button x:Name="SelectedHandPopupSelectButton"
                    Grid.Row="2"
                    Grid.ColumnSpan="4"
                    Width="48"
                    Height="48"
                    HorizontalAlignment="Center"
                    Style="{StaticResource RoundButtonCircleStyle}">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <MvvmLite:EventToCommand x:Name="SelectedHandCommand" Command="{Binding OutsVisibilityCommand}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
                <Image x:Name="SelectedHandSelect" Source="../Images/Icons/48/appbar.check.rest.png" />
            </Button>
        </Grid>
    </ControlTemplate>

</ResourceDictionary>